<form action="{$smarty.server.REQUEST_URI}" id="update_static_page" method="post">
<textarea id="static_page" name="static_page">{$data}</textarea>

<script type="text/javascript">

	$(document).ready( function() {
		
		{if !$smarty.const.AJAX}
		$('#content').css('overflow','hidden');
		{/if}
		
		
		var config = {
			customConfig :'/resources/js/ckeditor/config.js',
			fullPage:true,
			extraPlugins : 'docprops',
			{if !$smarty.const.AJAX}
			height:$('#content').height()-130,
			width: $('body').width(),
			{/if}
			baseHref : "http://{$smarty.server.HTTP_HOST}",
			skin: 'kama,/resources/js/ckeditor/skins/kama'
		};
		var editor = CKEDITOR.replace('static_page',config);
		
		{if !$smarty.const.AJAX}
		$(window).resize( function() {
			editor.resize($('body').width(),$('#content').height()-130,true);
		});
		{/if}
	
		editor.on('beforeCommandExec', function (event) {
	            if (event.data.name === 'save') {
	                event.cancel();
	                $("#static_page").val( editor.getData() );
	                $('#update_static_page').submit();
	            }
	    });
		
		$('#update_static_page').submit( function() {
			var dataString = "static_page="+encodeURIComponent( );
			$.ajax({  
	 		 type: $(this).attr('method'),
	 		 url: $(this).attr('action'),
	 		 data: $(this).serialize()
			});
			return false;
		});
		
	});

</script>
</form>